#include "searcher.hpp"
#include <cstring>
#include <cstdio>
#include <iostream>
#include <string>

const std::string input = "data/output/raw.txt";

int main(){
  //for debug
  ns_searcher::Searcher *search = new ns_searcher::Searcher();
  search->InitSearcher(input);
  std::string query;
  std::string json_string; 
  char buffer[1024] = {0};
  while (true){
    std::cout << "Please Enter You Search Query#";
    fgets(buffer, sizeof(buffer) - 1, stdin);
    std::cout << buffer << std::endl;
    buffer[strlen(buffer) - 1] = 0;
    query = buffer;
    search->Search(query, &json_string);
    std::cout << json_string << std::endl;
  }
  return 0;
}
